package chatclient.tools;


public class FilterKey implements Comparable<FilterKey> {

    private String part1;
    private String part2;

    public FilterKey(String part1, String part2) {
        this.part1 = part1;
        this.part2 = part2;
    }

    public String getPart1() {
        return part1;
    }
    
    public String getPart2()
    {
        return part2;
    }

    @Override
    public int compareTo(FilterKey o) {
        return o.getPart1().length() - part1.length();
    }
    
    @Override
    public boolean equals(Object o)
    {
        if(o instanceof FilterKey)
        {
            FilterKey fo = (FilterKey)o;
            return fo.getPart1().length() == part1.length();
        }
        else
        {
            return false;
        }
    }
}
